package com.tsx.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.tsx.dto.UserRequest;
import com.tsx.utils.JsonUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequiredArgsConstructor
public class TestController {
    private final ObjectMapper objectMapper;

    @PostMapping("/test")
    public UserRequest userRequest(@RequestBody UserRequest userRequest) {
        log.info("userRequest:{}", JsonUtils.toJson(userRequest));
        return userRequest;
    }
}
